<template>
	<div class="wraper" :class="{padTop:isIphoneX,iphone:isIphone,isMYKEY:isMYKEY,error:error}">
		<div class="nav-bar">
			<div class="arrow" @click="goBack"></div>
			<span @click="editPayType">修改支付信息</span>
		</div>
		<div class="content">
			<h1><img :src="logo" />出售{{name}}</h1>
			<div class="item">
				<span>收款方式</span>
				<b v-if="type==1"><img src="../../static/images/alipay.png">支付宝</b>
				<b v-if="type==3"><img src="../../static/images/weixin.png">微信</b>
				<b v-if="type==2"><img src="../../static/images/bankCard.png">银行卡</b>
			</div>
			<div class="item">
				<span>单价</span>
				<b>￥{{allPrice}}</b>
			</div>
			<div class="item">
				<span>数量</span>
				<b>{{account}}{{name}}</b>
			</div>
			<div class="all-price">￥{{allPrice}}</div>
			<div class="btns">
				<div class="cancel" @click="goBack">取消</div>
				<div class="conform" @click="goSell">出售{{name}}</div>
			</div>
			<div class="c-info">
				<p>·数字货币价格会在较短时间内波动，<span>人民币实际到账金额可能略有差异</span>（偏高或偏低）</p>
			</div>
		</div>
		<van-popup 
			v-model="dialogBox"
			overlay-class="sell-page"
			position="bottom">
			<div class="send-box">
				<div class="title"><b>安全验证</b><span @click="closeBox">取消</span></div>
				<div class="main" :class="{iphoneX:isIphoneX}">
					<div class="phone">{{mobile}}</div>
					<div class="input-box">
						<input @blur="blur" type="number" v-model="randCode" placeholder="请输入验证码">
						<span @click="sendRandCode" v-if="btnStatus===1">发送</span>
						<van-button class="icon-loading" loading v-if="btnStatus===2" type="primary" loading-type="spinner" />
						<i class="already" v-if="btnStatus===3">{{leftSec}}秒后重新发送</i>
					</div>
					<van-button @click="upload" :loading="loading" class="btn" type="primary" :color="btnBgColor">确认</van-button>
				</div>
			</div>
		</van-popup>
	</div>
</template>
<script src="./sell.js"></script>
<style scoped>
	@import './sell.css';
</style>
<style>
	.van-overlay.sell-page{
		background-color: rgba(0,0,0,.5);
	}
	.sellType-mark{
		background-color: rgba(0,0,0,.5);
	}
	.van-dialog.sellType-dialog{
		width: 5.07rem;
		border-radius: 0.22rem;
	}
	.van-dialog.sellType-dialog .van-dialog__header{
		padding-top: 0.4rem;
		font-size: 0.32rem;
		color: #2E3D4D;
		font-weight: bold;
	}
	.van-dialog.sellType-dialog .van-dialog__message{
		font-size: 0.25rem;
		padding: 0.1rem 0 0.35rem 0;
		color: #2E3E4D;
	}
	.van-dialog.sellType-dialog .van-button{
		height: 0.8rem;
		line-height: 0.8rem;
		font-size: 0.32rem;
	}
	.van-dialog.sellType-dialog .van-dialog__confirm{
		font-weight: 600;
	}
</style>